<template>
	<view class="plan-container">
		<u-navbar bgColor="#000000" placeholder fixed height="90">
			<view class="u-nav-slot" slot="left">
				<text>计划</text>
			</view>
		</u-navbar>
		<CommonNav name="目标设定" :show="false" style="margin-top: 40rpx;"></CommonNav>
		<!-- 目标设定模块 -->
		<view class="setting-box">
			<view class="box-item" v-for="(item,index) in listData" :key="index" @click="toPages(item)">
				<view class="name">
					<view class="title" :style="{color:item.color}">{{item.title}}</view>
				</view>
				<view class="tags"># {{item.tag}}</view>
			</view>
			<!-- 定制计划 -->
			<view class="custom">
				<view class="custom-left">
					<view class="custom-title">
						定制你的个性训练计划
					</view>
					<view class="custom-desc">
						每日锻炼是必不可少的一部分哟！
					</view>
					<navigator class="plan" url="./customization">
						定制计划
					</navigator>
				</view>
				<view class="custom-right">
					<image src="../../static/imgs/custom-plan.png"></image>
				</view>
			</view>
			<!-- 计划推荐 -->
			<view class="plan-recommends">
				<CommonNav name="计划推荐" :show="false" style="margin-top: 40rpx;"></CommonNav>
				<view class="recommend-box">
					<view class="recommend-item">
						<image src="../../static/imgs/recommend1.png"></image>
						<text>腹肌强化</text>
					</view>
					<view class="recommend-item">
						<image src="../../static/imgs/recommend2.png"></image>
						<text>身材塑性</text>
					</view>
				</view>
			</view>
			
		</view>
	</view>

</template>

<script>
	import CommonNav from "../../components/CommonNav.vue"
	export default {
		components: {
			CommonNav
		},
		data() {
			return {
				listData: [{
						title: "The whole body",
						tag: "全身",
						color: "#77EB80",
						path:"/pages/plan/whole"
					},
					{
						title: "Abdomen",
						tag: "腹部",
						color: "#8560E4"
					},
					{
						title: "Loins",
						tag: "腰部",
						color: "#F37579"
					},
					{
						title: "Legs",
						tag: "腿部",
						color: "#E98D44"
					},
					{
						title: "Arm",
						tag: "手臂",
						color: "#1B3EF2"
					}
				]
			};
		},
		methods:{
			toPages(val){
				uni.navigateTo({
					url:val.path
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.u-nav-slot {
		font-size: 46rpx;
		font-weight: bold;
	}

	.plan-container {
		height: 100%;
		background-color: #000000;
		overflow-y: auto;
		padding: 0 50rpx;

		.setting-box {
			margin: 40rpx 0;
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;

			.box-item {
				margin-bottom: 20rpx;
				width: 240rpx;
				padding: 30rpx;
				border-radius: 30rpx;
				border: 1px solid #000000;
				background: #262626;

				.title {

					font-size: 46rpx;
					font-family: Swiss721BT;
					font-weight: bold;
					height: 180rpx;
				}

				.tags {
					width: 122rpx;
					border-radius: 26rpx;
					border: 1px solid #000000;
					background: #000000;
					height: 52rpx;
					text-align: center;
					line-height: 52rpx;
				}
			}
		}

		.custom {
			width: 100%;
			border-radius: 30rpx;
			padding: 40rpx 60rpx;
			border: 1px solid #000000;
			background: #262626;
			display: flex;
			align-items: center;
			margin-top: 40rpx;

			.custom-left {
				.custom-title {
					font-size: 28rpx;
					font-weight: 400;
				}

				.custom-desc {
					margin-left: 10rpx;
					font-size: 20rpx;
					margin-top: 10rpx;
				}

				.plan {
					width: 167rpx;
					border-radius: 30rpx;
					border: 1px solid #000000;
					background: #FFFFFF;
					height: 64rpx;
					color: #F04E39;
					line-height: 64rpx;
					text-align: center;
					margin-top: 40rpx;
				}
			}

			.custom-right {
				image {
					width: 174rpx;
					height: 174rpx;
				}
			}
		}

		.plan-recommends {
			width: 100%;
			.recommend-box {
				margin-top: 40rpx;
				padding: 40rpx;
				border-radius: 30rpx;
				background: #262626;
				display: flex;
				justify-content: space-between;
				.recommend-item {
					width: 262rpx;
					position: relative;
					image{
						width: 262rpx;
						height: 247rpx;
					}
					text{
						position: absolute;
						bottom: 20rpx;
						right: 20rpx;
					}
				}

			}
		}
	}
</style>
